package cn.wolfcode.user.service.impl;

import cn.wolfcode.user.dao.UserDAO;
import cn.wolfcode.user.dao.impl.UserDAOImpl;
import cn.wolfcode.user.domain.User;
import cn.wolfcode.user.service.UserService;

public class UserServiceImpl implements UserService {
    private UserDAO userDAO = new UserDAOImpl();
    @Override
    public User check(String username, String password) {
        User user = userDAO.check(username, password);
        if (user == null) {
            throw new RuntimeException("用户名或密码错误");
        }
        return user;
    }
}
